<%@ page session="true" language="java" contentType="text/html; charset-UTF-8"  pageEncoding="UTF-8" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!-- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0.1 Transitional//EN" http://www.w3.org/TR/html4/loose.dtd"> -->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">	 
    <c:url value="/admin/map/engine/records" 		var="getMapEngines"/>
    <c:url value="/admin/map/engine/create"  		var="registerMapEngine"/>
    <c:url value="/admin/map/engine/update"   		var="editMapEngine"/>
    <c:url value="/admin/map/engine/inline/update"  var="inlineEditMapEngine"/>
    <c:url value="/admin/map/engine/delete"   		var="deleteMapEngines"/>
    <c:url value="/admin/map/engine/descriptor"   	var="descriptorDigestUrl"/>
    <c:url value="/admin/map/engine/settings/save"  var="applicationSettingsUrl"/>    
        
    <c:url value="/admin/mapengine/config/getMapConfiguration"  var="empConfigUrl"/>
    <c:url value="/admin/mapengine/config/getMapEngines"  		var="getEngines"/>    

<head>	          
    <title>Map Engine Registration</title>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8"></meta>
    <meta http-equiv="encoding"     content="utf-8"></meta>
	
<%-- 
      <link rel="stylesheet" type="text/css" media="screen" href='<c:url value="/admin/css/jqgrid/cupertino/jquery-ui-1.8.23.custom.css"/>'/> 
      <link rel="stylesheet" type="text/css" media="screen" href='<c:url value="/admin/css/jqgrid/ui.jqgrid-4.4.1.css"/>'/>
      <link rel="stylesheet" type="text/css" media="screen" href='<c:url value="/admin/css/bootstrap_cerulean.css"/>'/>
--%>
      
	<style type="text/css">          
		.center .ui-jqgrid { width: 500px; margin-left: auto; margin-right: auto; }
	    .engineAltRow { background-color: #A8D1FF; color: #000;opacity: 0.9 !important;}
	    .ui-jqgrid.jqgrow.engineAltRow { background-color: #A8D1FF: ;color: #000;opacity: 0.8 !important;}    	    	    
	     
	 	/*.ui-jqgrid tr.jqgrow td { font-size: 0.72em;white-space:normal !important;color:#696969;letter-spacing:0.03em;font-family:Tahoma,Monaco,"Courier New"; }   */    
	 	.ui-jqgrid .ui-jqgrid-htable th div { white-space:normal !important;height:auto !important; }
	 	.ui-jqgrid .ui-jqgrid-view { font-size: 12px; }
	    
	    #pager3 { height: 38px; }          
	    #pager3_center { visibility: hidden; }
	    #pager3_right  { visibility: hidden; }	    
	    
	    a[title]:hover:after {
	    	content: attr(title);
	    	padding: 4px 8px;
	    	position: absolute;
	    	color: #900;
	    	left: -55px;
	    	right: -176px;
	    	top: -87px;
	    	white-space: wrap;
	    	z-index: 20px;
	    	-moz-border-radius: 5px;
	    	-webkit-border-radius: 5px;
	    	border-radius: 5px;
	    	-moz-box-shadow: 0px 0px 4px #222;
	    	-webkit-box-shadow: 0px 0px 4px #222;
	    	box-shadow: 0px 0px 4px #222;
	    	background-image: -moz-linear-gradient(top, #eeeeee, #cccccc);
	    	background-image: -webkit-gradient(linear,left top, left bottom, color-stop(0, #eeeeee),color-stop(1, #cccccc));
	    	background-image: -webkit-linear-gradient(top, #eeeee, #cccccc);
	    	background-image: -moz-linear-gradient(top, #eeeeee, #cccccc);
	    	background-image: -ms-linear-gradient(top, #eeeeee, #cccccc);
	    	background-image: -o-linear-gradient(top, #eeeeee, #cccccc);
	    }
	    
	    div.ui-dialog {
	    	z-index: 955;
	    }
	</style>

	<script type='text/javascript' src="js/form/json-formbuilder.js"></script>
    <script type='text/javascript'>    	
      	//globals
      	var gridCols = {set:false},
      	gridMultiSelect = 1,
      	selArr = [],      
      	lastsel;
      	emp.configManager.actions = {
      			ADD: "ADD",
      			DEL: "DEL",
      			EDT: "EDT"
      	};
      	
      	$(function() {
      		$("#grid-map-engine").jqGrid({
      			url:'${getMapEngines}',
      			index:'id',
      			datatype: 'json',
      			mtype: 'GET',
      			colNames:['Id', 'Name', 'Url'],
      			colModel:[
      			          {name:'id', index:'id', width:55, editable:true, editrules:{required:true} , editoptions:{size:10},hidden:true, key:true},
      			          {name: 'name', index: 'name', width:300, editable: true, editrules: {required: true}, editoptions: {size: 50}, cellattr: function(rowId, tv, rawObject, cm, rdata) {
      			        	  return 'style="white-space: normal;"';      			        	  
      			          }},
      			          {name: 'url', index: 'url', width: 400, editable: true, editrules: {required: true}, editoptions: {size: 50}, cellattr: function(rowId, tv, rawObject, cm, rdata) {
      			        	  return 'style="white-space: normal;"';
      			          }},
      			],
      			postData: {},
      			rowNum:10,
      			rowList:[10,20,40,60],
      			height: 'auto',
      			autowidth: false,
      			width: 'false',
      			rownumbers: true,
      			pager: '#pager3',
      			sortname: 'name',
      			viewrecords: true,
      			sortorder: "asc",
      			caption:"Map Engine Registration",
      			emptyrecords: "Empty records",
      			loadonce: false,
      			shrinkToFit: true,
      			altRows:true,
      			altClass:'engineAltRow',
      			multiselect: gridMultiSelect > 0,
      			multiselectWidth: 25,     
      			onSelectRow: function(id) {
      				rowSelectionHandler();
					/* if ( id && id !== lastsel ) { 
						jQuery('#grid-map-engine').restoreRow(lastsel);
						lastsel = id;						
					} */
				}, 
				/* ondblClickRow: function(id) { 
					if ( id && id !== lastsel ) { 
						jQuery('#grid-map-engine').restoreRow(lastsel); 
						jQuery('#grid-map-engine').editRow(id, true); 
						lastsel = id;						
					} 
				},
				editurl: function() {
					// inlineEdit('admin/map/engine/inline/update');
					editMapEngine();
				},    			 */
      			onSelectAll: selectAllHandler,
      			gridComplete: gridLoadInit2,      			
      			loadComplete: function(response) {
      				var rows = response.rows;
      				emp.configManager.config.mapEngines = rows;
      			},
      			jsonReader : {
      				root: "rows",
      				page: "page",
      				total: "total",
      				records: "records",
      				repeatitems: false,
      				cell: "cell",
      				id: "id"      				
      			}			
      		});               
      		
       		$("#grid-map-engine").jqGrid({pgbuttons:false, recordtext:''});       		
/*        		
 			jQuery('#grid-map-engine tbody').sortable( {
				stop:function(event, ui) {
					updateOrder();
				}
			}); 
*/
      		
      		$("#grid-map-engine").jqGrid('navGrid','#pager3', {edit:false, add:false, del:false, search:false, refresh:false}, {}, {}, {}, { 	// search
	      			sopt:['cn', 'eq', 'ne', 'lt', 'gt', 'bw', 'ew'],
	      			closeOnEscape: true,      					
	      			multipleSearch: true,
	      			closeAfterSearch: true
      			}
      		);               
      		
      		$("#grid-map-engine").jqGrid('gridResize',{minWidth: 350, minHeight: 300});

       		$("#grid-map-engine").navButtonAdd('#pager3', { 	
      			caption:"",      			   			
      			title: "Reload records",
      			buttonicon:"ui-icon-refresh",
      			onClickButton: reloadMapEngineGrid,
      			position: "first",      
      			cursor: "pointer"      			
      		});      		      		
      		
       		$("#grid-map-engine").navButtonAdd('#pager3', { 	
      			caption:"",      		   			
      			title: "Add a record",
      			buttonicon:"ui-icon-plus",
      			onClickButton: registerMapEngine,
      			position: "second",   
      			cursor: "pointer"      			
      		});	
      		
      		$("#grid-map-engine").navButtonAdd('#pager3', { 	
      			caption:"",		
      			title: "Edit a record",
      			buttonicon:"ui-icon-pencil",
      			onClickButton: editMapEngine,                   
      			position: "third",
      			cursor: "pointer"      			
      		});	
      		
      		$("#grid-map-engine").navButtonAdd('#pager3', { 	
      			caption:"",		
      			title: "Delete a record",      			
      			buttonicon:"ui-icon-trash",
      			onClickButton: deleteMapEngine, 
      			position: "fourth",
      			cursor: "pointer"      			
      		}); 
      		
      		$("#grid-map-engine").navButtonAdd('#pager3', { 	
      			caption:"",		
      			title: "Load engine settings",
      			buttonicon:"ui-icon-gear",
      			onClickButton: launchApplicationSettings,                   
      			position: "last",
      			cursor: "pointer"      			
      		});	
      	});          
      	
      	function registerMapEngine() {
      		$("#grid-map-engine").jqGrid('setColProp', 'id', {editrules:{required:false}} );
 		
      		// Get the currently selected row 
      		$('#grid-map-engine').jqGrid('editGridRow','new', {
				type: "PUT",
      			url: '${registerMapEngine}',
      			editData: {},
      			width:500,
      			serializeEditData: function(data) {    
      				data.id = 0;
      				return $.param(data);                        				
      			},                   
      			recreateForm: true,
      			beforeShowForm: function(form) {
      				$('#pData').hide(); 
      				$('#nData').hide();
      				//$('#password',form).addClass('ui-widget-content').addClass('ui-corner-all');      				
      			},
      			beforeInitData: function(form) {},
      			beforeCheckValues: function(postdata,formid,mode) {
      				$("#grid-map-engine").jqGrid('setColProp', 'id', {editrules:{required:false}}, {editable:false} );      				
      			},
      			closeAfterAdd: true,
      			reloadAfterSubmit:true,
      			beforeSubmit : function() {
      				emp.$('body').addClass("loading");
      				return [true, "Loading"];      	
      			},
      			afterSubmit : function(response, postdata) {
      				var resp = $.parseJSON(response.responseText);
      				var errors = "";
      				
      				if (resp.success == false) {
      					for (var i = 0; i < resp.message.length; i++) {
      						errors +=  resp.message[i] + "<br/>";      						
      					}      					
      				} else {
      					var msg = 'Entry has been added successfully';
      					if (isEmpty(resp.properties)) {      						
          					$('#msgbox').text(msg)
          					.append($('<span></span>')
          					.addClass('error-text-sml')
          					.text('\n\n\rNo additional properties found')
          					);      						
      					} else {
          					$('#msgbox').text(msg);	
      					}
      					
      					$('#msgbox').dialog( {	
      						title: 'Success',
      						modal: true,
      						buttons: {
      							"Ok": function()  {
      								$(this).dialog("close");
      							}      					
      						}      					
      					});
      				}

      				updateConfigManager(resp.result, emp.configManager.actions.ADD);
      				// only used for adding new records 
      				var newId = null;
      				//force reloading 
      				$("#grid-map-engine").trigger("reloadGrid"); 
      				emp.$('body').removeClass("loading");
      				return [resp.success, errors, newId];      				
      			}
      		});		      		
      	} // end of registerMapEngine
      	
      	function editMapEngine() {     		
      		// Get the currently selected row 
      		var row = $('#grid-map-engine').jqGrid('getGridParam','selrow');
     		
      		if( row != null ) {	
      			$('#grid-map-engine').jqGrid('editGridRow', row, {
      				url: '${editMapEngine}',
      				editData: {},
      				width:500,
      				recreateForm: true,
      				beforeShowForm: function(form) {
      					$('#pData').hide(); 
      					$('#nData').hide();   
  						return [true, "not going to happen"];  
      				},      				
      				beforeSubmit: function(postdata, formid) {
      					// postdata.prevServerUrl = $('#grid-map-engine').jqGrid('getCell', row, 'name');     		
      					// emp.$('body').addClass("loading");
      					loadingGif(true);
       					
      					var mapEngine = emp.configManager.config.mapEngines[selectedRow('grid-map-engine').rowIdx-1];
      					var inputURL = $('#url').val();
      					var inputName = $('#name').val();
      					
      					if ( mapEngine.url == inputURL && mapEngine.name == inputName ) { 
      						$("#editmodgrid-map-engine").css('z-index', 945);
	      					$('#msgbox').text('Application Settings will be lost!  All values will reset to their default values');      					       						
	      					$('#msgbox').dialog( {
		      					title: 'Warning',
		      					modal: true,
		      					buttons: {
		      						"Ok": function() {	    	     				 
      									processEdit(true, inputURL, inputName);
		      	      					return [true, ""];
		      						},
		      						"Cancel" : function() {			      							 
		          						$("#editmodgrid-map-engine").css('z-index', 977);
      									$(this).dialog("close");
		      						}
	      						}					      						
	      					});
      					} else {
							processEdit(false, $('#url').val(), $('#name').val());
      						return [true, "Success"];      						
      					}    					      					
      				},
      				beforeInitData: function(form) {
      				},
      				closeAfterEdit: true,
      				reloadAfterSubmit:true,
      				afterSubmit : function(response, postdata) { 
          				emp.$('body').removeClass("loading");          				
      				}  				      				      			      			
      			});
      		} else {
      			$('#msgbox').text('You must select a record first!');
      			$('#msgbox').dialog({
      				title: 'Error',
      				modal: true,
      				buttons: {
      					"Ok": function() {
      						$(this).dialog("close");      			
      					}
      				}      			
      			});      			
      		}     		
      	}
      	
      	function processEdit(reload, inputURL, inputName) {			
			var rowId = selectedRow('grid-map-engine').rowId;
/* 			var inputURL = $('#url').val();
			var inputName = $('#name').val(); */

			var data = "id=" + rowId + "&name=" + inputName + "&url=" + inputURL + "&reload="+reload;

      		$.ajax({
    			type: "POST",
    			url: '${editMapEngine}',
    			data: data,
    			success: function (response) {
    				//emp.configManager = data;
    				var resp = response;
					var errors = "";	
					
					if (resp.success == false) {
						for (var i = 0; i < resp.message.length; i++) {
							errors +=  resp.message[i] + "<br/>";
						}      						
					} else {						      						
						$('#msgbox').text('Entry has been edited successfully');          		
						$('#msgbox').dialog( {
							title: 'Success',
							modal: true,
							buttons: {
								"Ok": function() {
									$(this).dialog("close");     			
  			      					$(".ui-icon-closethick").trigger('click');						      									
								}
							}					      						
						});
					}
					
					updateConfigManager(resp.result[0], emp.configManager.actions.EDT);
					// only used for adding new records 
					var newId = null;
					//force reloading 
					$("#grid-map-engine").trigger("reloadGrid");
    			},
    			failure: function (data) {
    				alert(resp.status, errors, newId);
    			},
    			async: false
    		});
				                                               					
		} 
      	
      	function deleteMapEngine() {
      		// Get the currently selected row 
      		var row = $('#grid-map-engine').jqGrid('getGridParam','selrow');
      		var selRows = $('#grid-map-engine').jqGrid('getGridParam', 'selarrrow');      		
      		var stringArray = selRows;
      		
      		for (var i = 0; i < selRows.length; i++) {
      			stringArray[i] = $('#grid-map-engine').jqGrid('getCell', selRows[i], 'id');
      		}
      		
      		// A pop-up dialog will appear to confirm the selected action
      		if( row != null )
      			$('#grid-map-engine').jqGrid( 'delGridRow', row, {
      				url:'${deleteMapEngines}',      				
      				recreateForm: true,
      				beforeShowForm: function(form) {
      					//Change title
      					$(".delmsg").replaceWith('<span style="white-space: pre;">' + 'Delete selected record?' + '</span>');
      					//hide arrows
      					$('#pData').hide();
      					$('#nData').hide();              		         					
      				},
      				beforeSubmit: function(postdata, formid) {
      					return [true, ""];
      				},
      				reloadAfterSubmit:true,
      				closeAfterDelete: true,
      				serializeDelData: function (postdata) {
     					// send array of IDs to be removed from the source 
      					return {ids: stringArray.join(",")};
      				},
      				afterSubmit : function(response, postdata) {	
          				var resp = $.parseJSON(response.responseText);
      					var errors = "";      			
      					
      					if (resp.success == false) {
      						for (var i = 0; i < resp.message.length; i++) {
      							errors +=  resp.message[i] + "<br/>";      							
      						}
      					}  else {              				
      						$('#msgbox').text('Entry has been deleted successfully');
      						
      						$('#msgbox').dialog({
      							title: 'Success',
      							modal: true,
      							buttons: {
      								"Ok": function() {
      									$(this).dialog("close");      									
      								}      						
      							}
      						});
      					}

          				updateConfigManager(selRows, emp.configManager.actions.DEL);

      					// only used for adding new records
      					var newId = null;
      					
      					//force reloading
      					$("#grid-map-engine").trigger("reloadGrid");        	
      					
      					return [resp.success, errors, newId];      					
      				}     				      				
      			});      		
      		else {
      			$('#msgbox').text('You must select a record first!');
      			$('#msgbox').dialog({	
      				title: 'Error',
      				modal: true,
      				buttons: {
      					"Ok": function() {
      						$(this).dialog("close");      						
      					}      			
      				}      			
      			});      			
      		}      		
      	}
      	
      	function updateConfigManager(data, action) {
      		if (action === emp.configManager.actions.ADD) {
      			emp.configManager.config.mapEngines.push(data);
      		} else if (action === emp.configManager.actions.DEL) {
      			removeMapEngine(data);
      		} else if (action === emp.configManager.actions.EDT) {
      			editConfigManagerMapEngine(data);
      		}
      	};
      	
      	function removeMapEngine(ids) {
      		for (var i = 0; i < ids.length; i++) {
          		emp.configManager.config.mapEngines.splice(getMapEngineIndex(ids[i]),1);
			}
      	};
      	
      	function getMapEngineIndex(id) {
      		var idx = -1;
      		
      		for (var i = 0; i < emp.configManager.config.mapEngines.length; i++) {
				if (emp.configManager.config.mapEngines[i].id == id) {
					return i;
				}
			}
      		
      		return idx;
      	}
      	
      	function editConfigManagerMapEngine(data) {
      		var idx = getMapEngineIndex(data.id);
      		emp.configManager.config.mapEngines[idx] = data;
      	};
      	
      	function reloadMapEngineGrid() {
      		reloadConfigManager();
			$("#grid-map-engine").trigger("reloadGrid", [{page:1}]);
			
      	}
      	
      	function reloadConfigManager() {
      		$.ajax({
      			type: "GET",
      			url: '${empConfigUrl}',
      			success: function (response) {
      				var resp = response;
      				var errors = "";	
      				
      				if (resp.success == false) {
      					for (var i = 0; i < resp.message.length; i++) {
      						errors +=  resp.message[i] + "<br/>";
      					}      						
      				} else {
      				}
      				
      				emp.configManager.config = resp;
      				
      				//force reloading 
      				$("#grid-map-engine").trigger("reloadGrid");
      			},
      			failure: function (data) {
      				alert(resp.success, errors, newId);
      			}
      		});
      	}
           
   		/*
   		* FUNCT1ION gridLoadInit2
   		* This method is tied to grid loads, through the gridComplete attribute
   		* Any time the data is refreshed in the grid (page load, paging, manual reset, etc)
   		* then this method is run to set event bindings on any created DOM. We also
   		* use this method to re-'check' any records previously selected.
   		*/   		
   		var gridLoadInit2 = function () {
   			// if the 'selected' array has length 
   			// then loop current records, and 'check' 
   			// those that should be selected 
   			if (selArr.length > 0) {
   				var tmp = $("#grid-map-engine").jqGrid('getDataIDs');
   				$.each(selArr, function(ind, val){
   					var pos = $.inArray(val, tmp);
   					if (pos > -1) {
   						$("#grid-map-engine").jqGrid('setSelection',val);   						
   					}   					
   				});   				
   			}
   			
   			$('#grid-map-engine ' + 'tr').removeClass("ui-widget-content");
   			$('#grid-map-engine ' + 'tr:nth-child(odd)').addClass('engineAltRow');
   		};
   		
   		/*
   		* FUNCTION gridUnloader
   		* Called from within the populateGrid method, this method is to unbind
   		* any event handlers created during grid load, by the gridLoadInit2 method.
   		*/
   		var gridUnloader = function () {   			
   		};
   		
   		/*
   		* FUNCTION selectionManager
   		* Used to handle selections across paging requests
   		*/
   		var selectionManager = function (id, status) {
   			// was it checked (true) or unchecked (false)
   			if(status) {
   				// if it's just one id (not array)
   				if(!$.isArray(id)) {
   					// if it's not already in the array, then add it
   					if ($.inArray(id, selArr) < 0) {
   						selArr.push(id);   						
   					}   					
   				} else {
   					// which id's aren't already in the 'selected' array
   					var tmp = $.grep(id, function(item,ind){
   						return $.inArray(item, selArr) < 0;   						
   					});
   					// add only those unique id's to the 'selected' array
   					$.merge(selArr, tmp);   					
   				}   				
   			} else {
   				// if it's just one id (not array)
   				if(!$.isArray(id)){
   					// remove that one id
   					selArr.splice($.inArray(id, selArr), 1);   					
   				} else {
   					// give me an array without the 'id's passed
   					// (resetting the 'selected' array)
   					selArr = $.grep(selArr, function(item, ind){
   						return $.inArray(item, id) > -1;   						
   					}, true);   					
   				}   				
   			}		
   		};
   		
   		/*
   		* FUNCTION rowSelectionHandler
   		* Used to handle row selections
   		*/
   		var rowSelectionHandler = function (id, status) {
   			selectionManager(id, status);  			
   		};
   		
   		/*
   		* FUNCTION selectAllHandler
   		* Used to handle selection of all records displayed
   		*/
   		var selectAllHandler = function (idArr, status) {   			
   			selectionManager(idArr, status);   			
   		};  		   		   		
   		
   		function launchApplicationSettings() {            		
      		// Get the currently selected row 
      		var row = $('#grid-map-engine').jqGrid('getGridParam','selrow');
	 		$('.modal-footer').show();
     		
      		if( row != null ) {	
      			launchSettingsModal( $('#grid-map-engine tr#' + row) );
      		} else {
      			$('#msgbox').text('You must select a record first!');
      			$('#msgbox').dialog({
      				title: 'Error',
      				modal: true,
      				buttons: {
      					"Ok": function() {
      						$(this).dialog("close");      						
      					}
      				}      			
      			});      			
      		}      		
      	};
    </script>
	
</head>

<body>
	<div id="emp-map-engine-div">
		<div id="jqgrid-mapEngine" style="overflow-x: auto;overflow-y:hidden;">
			<table id="grid-map-engine"></table>
			<div id="pager3"></div> 
		</div>
	</div>
	<div aria-hidden="true">	
		<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-hidden="true" aria-labelledby="modalTitle">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
						<h3 class="modal-title" id="modalTitle">Modal Title</h3>							 
					</div>
					<div class="modal-body" id="modalBody">
						...
					</div>
					
					<div class="modal-footer">
						<button id="modalClose" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
						<button id="modalSave"  type="button" class="btn btn-primary" data-dismiss="modal" onclick="saveSettings('${applicationSettingsUrl}')" >Save Changes</button>
					</div>
				</div>
			</div>
		</div>
	</div>
	  
<%-- 
	<!-- The actual JQuery code -->	
	<script type='text/javascript' src="js/lib/jquery-1.10.2.min.js"></script>	 
	<!-- The JQuery UI code -->
	<script type='text/javascript' src="js/lib/jquery-ui-1.10.3.custom.min.js"/></script>	
	<!-- The JQuery blockUI code -->
	<script type='text/javascript' src="js/lib/jquery.blockUI.js"/></script>
	<!-- The jqGrid language file code -->
	<script type="text/javascript" src="jqgrid/js/i18n/grid.locale-en.js"></script>
	<!-- The actual jqGrid code  -->
	<script type="text/javascript" src="jqgrid/js/jquery.jqGrid.min.js"></script>
	     
	  <script type='text/javascript' src='<c:url value="/admin/js/jquery-1.8.0.min.js"/>'></script>
      <script type='text/javascript' src='<c:url value="/admin/js/jquery-ui-1.8.23.custom.min.js"/>'></script>
      <script type='text/javascript' src='<c:url value="/admin/js/jqgrid/grid.locale-en-4.4.1.js"/>'></script>
      <script type='text/javascript' src='<c:url value="/admin/js/jqgrid/jquery.jqGrid.min.4.4.1.js"/>'></script>            
	  <script type='text/javascript' src="js/bootstrap.min.js"></script>      
--%>  

	<script type='text/javascript'>  	
	  	function updateMapEngines() {
			emp.configManager.load({path:"${empConfigUrl}", isSync: true});
	  	};
	</script>
</body>
</html>